﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <script type="text/javascript" src="lib/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.7/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="lib/icheck/icheck.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>资产登记</title>
</head>
<body>
    <div class="page-container">
        <form class="form form-horizontal" id="form-article-add">
            <h2 style="text-align:center">资产登记</h2>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>借款人员基本信息：</label>
                <div class="formControls col-xs-8 col-sm-9" id="add">
                    <div class="addBorrower" id="borrower0">
                        <div class="row cl">
                            <label class="form-label col-xs-3 col-sm-2"><span class="c-red "></span>借款人员姓名：</label>
                            <div class="formControls col-xs-3 col-sm-3">
                                <input type="text" class="input-text T_Name" value="" placeholder="请输入借款人员姓名" id="T_Name0" name="T_Name0">
                            </div>
                            <label class="form-label col-xs-3 col-sm-2"><span class="c-red"></span>身份证号：</label>
                            <div class="formControls col-xs-3 col-sm-4">
                                <input type="text" class="input-text T_Idcard" value="" placeholder="请输入身份证号" id="T_Idcard0" name="T_Idcard0">
                            </div>
                        </div>
                        <div class="row cl">
                            <label class="form-label col-xs-3 col-sm-2"><span class="c-red"></span>联系电话：</label>
                            <div class="formControls col-xs-3 col-sm-3">
                                <input type="text" class="input-text T_PhoneAll" value="" placeholder="请输入联系电话" id="T_Phone0" name="T_PhoneAll0">
                            </div>
                            <div class="formControls col-xs-6 col-sm-6">
                                <input type="button" class="btn btn-success" onclick="addborrower()" value="添加借款人" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4  col-sm-2"><span class="c-red"></span>联系人：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="T_Linkman" name="T_Linkman">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>联系电话：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="T_Phone" name="T_Phone">

                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>房屋剩余年限：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="T_Loanyear" name="T_Loanyear">

                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>贷款额度：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="T_Loanlimit" name="T_Loanlimit">

                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">实际交易价：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="T_Actual" name="T_Actual">

                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">房屋坐落：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="T_Located" name="T_Located">

                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">房屋用途：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <span class="select-box">
                        <select class="select" id="T_PurposeID" name="T_PurposeID"></select>
                    </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">建成年代：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" id="T_Activate" name="T_Activate">

                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">报告类型：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <span class="select-box">
                        <select class="select" id="T_ReportID" name="T_ReportID"></select>
                    </span>
                </div>

            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">评估受理：</label>
                <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                    <span class="check-box">
                        <input id="T_Assess" class="T_Assess" name="T_Assess" type="checkbox" value="审核评估登记表" /><label for="P_assess">审核评估登记表</label>
                    </span>
                    <span class="check-box">
                        <input id="T_Assess" class="T_Assess" name="T_Assess" type="checkbox" value="身份证明" /><label for="P_assess1">身份证明</label>
                    </span>
                    <span class="check-box">
                        <input id="T_Assess" class="T_Assess" name="T_Assess" type="checkbox" value="房屋权属" /><label for="P_assess2">房屋权属</label>
                    </span>
                    <span class="check-box">
                        <input id="T_Assess" class="T_Assess" name="T_Assess" type="checkbox" value="网签合同" /><label for="P_assess3">网签合同</label>
                    </span>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">现场勘察分配：</label>
                <div class="formControls col-xs-4 col-sm-4">
                    <span class="select-box">
                        <select name="T_DepartmentID" class="select" id="T_DepartmentID">
                            <option value="0">延庆部</option>
                            <option value="1">昌平部</option>
                            <option value="1">海淀部</option>
                        </select>
                    </span>
                </div>
                <div class="formControls col-xs-4 col-sm-5">
                    <span class="select-box">
                        <select name="T_SiteSurveyid" class="select" id="T_SiteSurveyid">
                            <option value="0">张三</option>
                            <option value="1">李四</option>
                        </select>
                    </span>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-12 col-sm-12">
                    <button class="btn btn-success col-xs-offset-5 col-sm-offset-5" type="button" onclick=" insertPersonal()">登记</button>
                </div>
            </div>

        </form>
    </div>
    <!--基本js脚本-->
    <script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="lib/layer/2.1/layer.js"></script>
    <script type="text/javascript" src="lib/icheck/jquery.icheck.min.js"></script>
    <script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.min.js"></script>
    <script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
    <script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.min.js"></script>
    <script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
    <script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--扩展js脚本-->
    <script type="text/javascript" src="static/WebApi.js"></script>
    <script type="text/javascript" src="static/Operation.js"></script>
    <!--请在下方写此页面业务相关的脚本-->
    <script type="text/javascript">
        $(function () {
            $("option").remove();
            $('.skin-minimal input').iCheck({
                checkboxClass: 'icheckbox-blue',
                radioClass: 'iradio-blue',
                increaseArea: '20%'
            });
            //等级页面字典下拉框查询
            $.ajax({
                type: "get",
                url: ApiUrl + "api/Dictionary/GetHouseTypeList",
                data: {
                    Dmenuid: [1, 26]
                },
                success: function (data, status) {
                    if (status == "success") {
                        $("#T_PurposeID").empty();
                        $("#T_ReportID").empty();
                        $(data).each(function (i, obj) {
                            $(obj).each(function (j, item) {
                                switch (item.Dmenuid) {
                                    case 1:
                                        $("#T_PurposeID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                        break;
                                    case 26:
                                        $("#T_ReportID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                        break;
                                    default:
                                        break;
                                }
                            })
                        })
                    }
                },
                error: function (e) {
                },
                complete: function () {
                }
            });
            var P_DepartmentID = "";
            //添加用户信息页面-部门下拉框
            $.ajax({
                type: "get",
                url: ApiUrl + "api/Department/GetHouseType",
                async: false,
                success: function (data, status) {
                    if (status == "success") {
                        $(data).each(function (i, item) {
                            $("#T_DepartmentID").append("<option value=" + item.T_DepartmentID + ">" + item.T_Dname + "</option>");
                            P_DepartmentID = $("#T_DepartmentID").val();

                        })
                    }
                },
                error: function (e) {

                },
                complete: function () {

                }
            });
            //添加用户信息页面-员工下拉框
            Selectuser(P_DepartmentID);
            
            //部门发生变化时改变员工的下拉框
            $("#T_DepartmentID").change(function () {
                var s1 = $(this).val();

                //添加用户信息页面-员工下拉框
                Selectuser(s1);
            })


        });
        function Selectuser(id) {
            //添加用户信息页面-员工下拉框
            $.ajax({
                type: "get",
                url: ApiUrl + "api/Staff/GetHouseType",
                data: {
                    Dmenuid: id
                },
                success: function (data, status) {
                    if (status == "success") {
                        $(data).each(function (i, item) {
                            $("#T_SiteSurveyid").empty();
                            $("#T_SiteSurveyid").append("<option value=" + item.T_StaffID + ">" + item.T_Name + "</option>")
                        })
                    }
                },
                error: function (e) {

                },
                complete: function () {

                }
            });
        }
        window.a = 0;
        function addborrower() {
            a++;
            var html = '<div class="addBorrower" id=borrower' + a + '>'
                    + '<div class="row cl">'
                    + '    <label class="form-label col-xs-3 col-sm-2"><span class="c-red"></span>借款人员姓名：</label>'
                    + '    <div class="formControls col-xs-3 col-sm-3">'
                    + '        <input type="text" class="input-text T_Name"  placeholder="请输入借款人员姓名" id="T_Name' + a + '" name="T_Name' + a + '">'
                    + '    </div>'
                    + '    <label class="form-label col-xs-3 col-sm-2"><span class="c-red"></span>身份证号：</label>'
                    + '    <div class="formControls col-xs-3 col-sm-4">'
                    + '        <input type="text" class="input-text T_Idcard"  placeholder="请输入身份证号" id="T_Idcard' + a + '"  name="T_Idcard' + a + '">'
                    + '    </div>'
                    + '</div>'
                    + '<div class="row cl">'
                    + '    <label class="form-label col-xs-3 col-sm-2"><span class="c-red"></span>联系电话：</label>'
                    + '    <div class="formControls col-xs-3 col-sm-3">'
                    + '        <input type="text" class="input-text T_PhoneAll"  placeholder="请输入联系电话" id="T_PhoneAll' + a + '"  name="T_PhoneAll' + a + '">'
                    + '    </div>'
                    + '    <div class="formControls col-xs-6 col-sm-6">'
                    + '        <input class="btn btn-danger radius" onclick="removeborrower(' + a + ')" value="删除借款人" type="button"/>'
                    + '    </div>'
                    + '</div></div>';
            $("#add").append(html);
        }
        function removeborrower(a) {
            $('#borrower' + a + '').remove();
        }

    </script>
    <!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
